<template>
	<div class="error layout-padding">
		<div class="layout-padding-auto layout-padding-view">
			<div class="error-flex">
				<div class="content">
					<div class="left-item">
						<van-empty image="network">
							<template #description>
								<div class="left-item-animation left-item-num">404</div>
								<div class="left-item-animation left-item-title">地址输入错误，请重新输入地址~</div>
								<div class="left-item-animation left-item-msg">您可以先检查网址，然后重新输入或给我们反馈问题。</div>
							</template>
							<van-button type="primary" round @click="onGoHome">返回首页</van-button>
						</van-empty>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script setup lang="ts" name="notFound">
// 定义变量内容
const router = useRouter();

// 返回首页
const onGoHome = () => {
	router.push('/');
};
</script>

<style scoped lang="scss">
@keyframes error-num {
	0% {
		opacity: 0;
		transform: translateY(60px);
	}

	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes error-img {
	0% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}
}

.bottom-button {
	width: 160px;
	height: 40px;
}

.error {
	height: 100%;

	.error-flex {
		display: flex;
		width: 900px;
		height: 450px;
		margin: auto;

		.content {
			display: flex;
			flex: 1;
			align-items: center;
			height: 100%;

			.left-item {
				.left-item-animation {
					opacity: 0;
					animation-name: error-num;
					animation-duration: 0.5s;
					animation-fill-mode: forwards;
				}

				.left-item-num {
					font-size: 40px;
				}

				.left-item-title {
					margin: 15px 0 5px;
					font-size: 18px;
					animation-delay: 0.1s;
				}

				.left-item-msg {
					margin-bottom: 20px;
					font-size: 12px;
					animation-delay: 0.2s;
				}

				.left-item-btn {
					animation-delay: 0.2s;
				}
			}
		}
	}
}
</style>
